home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / samples / dos / miniplay.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-07  |  975 b   |  48 lines

  1. /*      miniplay.c
  2.  *
  3.  * A minimal module player for DOS
  4.  *
  5.  * Copyright 1996 Petteri Kangaslampi
  6. */
  7.  
  8. #include <conio.h>
  9. #include "midas.h"
  10.  
  11. #define MODULEFILE "..\\data\\templsun.xm"
  12.  
  13.  
  14. int main(void)
  15. {
  16.     int         error;
  17.     static gmpModule *module;
  18.  
  19.     /* Set MIDAS to default setup: */
  20.     midasSetDefaults();
  21.  
  22.     /* Initialize MIDAS: */
  23.     midasInit();
  24.  
  25.     /* Load the module (easy to change for MODs or S3Ms): */
  26.     if ( (error = gmpLoadXM(MODULEFILE, 1, NULL, &module)) != OK )
  27.         midasError(error);
  28.  
  29.     /* Play the module: */
  30.     midasPlayModule(module, 0);
  31.  
  32.     /* Wait for a keypress: */
  33.     printf("Playing \"%s\", press a key to quit\n", module->name);
  34.     getch();
  35.  
  36.     /* Stop playing the module: */
  37.     midasStopModule(module);
  38.  
  39.     /* Free the module: */
  40.     if ( (error = gmpFreeModule(module)) != OK )
  41.         midasError(error);
  42.  
  43.     /* Uninitialize MIDAS: */
  44.     midasClose();
  45.  
  46.     return 0;
  47. }
  48.